<?php
namespace Admin\Model;
use Think\Model;

//栏目信息表
class ClassifyModel extends Model {
	protected $tableName = 'classify';
	private $order = "sort desc,id asc";
//		$where = $this->_set_classIds();

	//获得一级栏目
	public function  get1jList($where = "1=1"){
		$where = $where.' and pid=0';
		$list = $this->field("id,pid,name")->where($where)->order($this->order)->select();
		return $list;
	}
	//获得相应一级栏目下的子级
	public function  getZjList($where = "1=1",$_pid = 1){
		$where = $where." and pid = '{$_pid}'";
		$list = $this->field("id,pid,name")->where($where)->order($this->order)->select();
		return $list;
	}
}